import types from './../types/indexTypes';

export default (state = { lists: [] ,detailData:{},resourceData:{} }, action)=>{
    var copyState = Object.assign({}, state);
    switch (action.type){
        case types.GET_LIST:
            var data = [
                {
                    title:'正在热映',
                    list:action.nowData
                },
                {
                    title:'新片速递',
                    list:action.commingData
                }
            ]
            copyState.lists = data;
            return copyState;
        case types.GET_DETAIL :

            copyState.detailData = action.detailData ;
            return copyState ;
        case types.RESOURCE_DETAIL:
        console.log('action' , action.resourceData)
            copyState.resourceData = action.resourceData
        default :
            return copyState;
    }
}